package com.zhuss.aop;

import javax.servlet.http.HttpServletRequest;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;

import com.zhuss.common.ResponseSucc;
import com.zhuss.exception.AabException;


/**
 * 异常包装统一返回给FE
 * @author zhuss
 * @since 2019-11-27 10:05
 *
 */

@EnableWebMvc
@ControllerAdvice
public class ExceptionHelper {
	
	@ResponseBody
	@ExceptionHandler(AabException.class)
	public ResponseSucc handler(HttpServletRequest req, AabException e) {
		e.printStackTrace();
		return new ResponseSucc(e);
	}

	
}
